/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once


#include "引擎枚举数据.h"
#include "底层绘图/底层绘图框架.h"
#include "S_Object.h"

#include "Input/Input.h"
#include "UI/UI.h"


enum E_窗口类型 {
	E_Win32,
	E_Glfw,
	E_SDL,
};


typedef struct {
	S_结构对象指针* m_Window;
	S_输入环境		m_Input;
}S_屏幕;


struct S_Window : public C_Widget {

	S_输入环境*		m_Input;
	E_绘图API		m_绘图API;
	S_结构对象指针	m_窗口钩柄;
	S_绘图框架*		m_绘图框架;

	
	C_Widget管理*	m_窗口GM;
	E_MS次数		m_采样;
	bool			m_是否有焦点;
	bool			m_可视;
	bool            m_绘制;


	void*	m_Window;
	void*	m_hWnd;
	void*	m_绘图设备配置;

	std::string	m_库路径;
	float32	m_帧数;
	bool		m_弹出窗口;


	S_Window(S_设备环境& Ctx);
	~S_Window();


	uint64	f_创建窗口(std::string 标题, int32 x = 0, int32 y = 0, int32 w = 1024, int32 h = 576, int32 style = 0, std::string path="");
	void	f_窗口重置();
	bool	f_轮询窗口事件();
	void	f_显示(bool s = false);
	void	f_创建绘制面(S_绘图框架* frame, S_设备环境& dev, ivec2 viewSize);
	ivec2	f_getSize();


	void f_设置标题(std::wstring 标题);
	void f_安装UI(C_Widget* ui);
	void f_清除UI();


private:
	

};



